package cn.xiaolang.function.test_map;

public class ExpireLruMapDemo {

	public static void main(String[] args) {
		ExpireLruMap<String, String> expireLruMap = new ExpireLruMap<>(16);
		expireLruMap.put("A", "1");
		expireLruMap.put("B", "2");
		expireLruMap.putExpire("C", "3", 3);
		expireLruMap.put("D", "4");
		expireLruMap.put("E", "5");
		System.err.println(expireLruMap);
		System.err.println(expireLruMap.get("C"));
		try {
			Thread.sleep(2000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.err.println(expireLruMap);
		System.err.println(expireLruMap.get("C"));
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.err.println(expireLruMap.get("C"));
		System.err.println(expireLruMap);

	}

}
